Color Special Effects

# 9 Color Special Effects

The AGB provides the following color special effects. The area where these effects are applied can be limited using a window.

1) Blending

Performs arithmetic operations on 2 selected surfaces and implements processing for 16 levels of semi-transparency.

2) Fade-in/Fade-out

Performs arithmetic operations on 1 selected surface and implements processing for 16 levels of brightness.

##

## 9.1 Selection of Color Special Effects

The types of color special effects and the target pixels, are determined by the BLDMOD register.

Although color special effects are specified by the BLDMOD register, for blending, which involves processing between surfaces, the 2 target surfaces must have suitable priorities.

In addition, semi-transparent OBJs are individually specified in OAM, and color special effects for the OBJ as a whole, are specified in the BLDMOD register. These specifications are summarized in the following table.

BLDMOD | Type | Color Special Effects Processing
d07 | d06
0 | 0 | No special effects | Normally, color special effects processing is not performed. 16-level semi-transparency processing ( blending) is performed only when a semi-transparent OBJ is present and is followed immediately by a 2nd target screen.

0

1

blending

(Semi-transparency processing)

If the 1st target screen is followed immediately by a 2nd target screen, 16-level semi-transparency processing ( blending) is performed.
The bits of the backdrop of the 1st target screen should be turned off ([d05]=0).
When OBJ = 1 for the 1st target pixel, processing is executed for all OBJs regardless of the OBJ type.
When OBJ=0, processing is executed only if the OBJ is semi-transparent.

1

0

Brightness Increase

Gradually increases brightness for 1st target screen.
The entire screen can gradually be made whiter by setting all bits of the specification for the 1st target screen to 1.
When OBJ=1 for the 1st target screen, processing for increased brightness is executed only for normal objects.
If a semi-transparent OBJ is the 1st target screen, blending processing is always executed.

1 | 1 | Brightness Decrease | Brightness is gradually decreased for the 1st target screen. The entire screen can gradually be made blacker by setting all bits of the specification for the 1st target screen to 1. When OBJ=1 for the 1st target screen, processing for decreased brightness is performed only for normal objects. If a semi-transparent OBJ is the 1st target screen, blending processing is always executed.

##

##

##

## 9.2 Color Special Effects Processing

### Coefficients for Color Special Effects

Coefficients used in blending processing are specified in EVA and EVB of the COLEV register.

The coefficient used in processing brightness changes is specified in EVY of the COLY register.

The values of EVA, EVB, and EVY are numbers less than 1 and are obtained by multiplying 1/16 by an integer.

EVA, EVB, EVY | Coeff. | EVA, EVB, EVY | Coeff.
0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 8/16
0 | 0 | 0 | 0 | 1 | 1/16 | 0 | 1 | 0 | 0 | 1 | 9/16
0 | 0 | 0 | 1 | 0 | 2/16 | 0 | 1 | 0 | 1 | 0 | 10/16
0 | 0 | 0 | 1 | 1 | 3/16 | 0 | 1 | 0 | 1 | 1 | 11/16
0 | 0 | 1 | 0 | 0 | 4/16 | 0 | 1 | 1 | 0 | 0 | 12/16
0 | 0 | 1 | 0 | 1 | 5/16 | 0 | 1 | 1 | 0 | 1 | 13/16
0 | 0 | 1 | 1 | 0 | 6/16 | 0 | 1 | 1 | 1 | 0 | 14/16
0 | 0 | 1 | 1 | 1 | 7/16 | 0 | 1 | 1 | 1 | 1 | 15/16
| 1 | X | X | X | X | 16/16

The color special effects arithmetic expressions that use the coefficients are shown below.

1. Blending (16 levels of semi-transparency) Operations

Display color (R) = 1st pixel color (R) ×EVA + 2nd pixel color (R)×EVB
Display color (G) = 1st pixel color (G) ×EVA + 2nd pixel color (G) ×EVB
Display color (B) = 1st pixel color (B) ×EVA + 2nd pixel color (B) ×EVB

2. Brightness Increase Operations

Display color (R) = 1st pixel (R) + (31 - 1st pixel (R) ) ×EVY
Display color (G) = 1st pixel (G) + (63 - 1st pixel (G) ) ×EVY
Display color (B) = 1st pixel (B) + (31 - 1st pixel (B) ) ×EVY

3. Brightness Decrease Operations

Display color (R) = 1st pixel (R) - 1st pixel (R) ×EVY
Display color (G) = 1st pixel (G) - 1st pixel (G) ×EVY
Display color (B) = 1st pixel (B) - 1st pixel (B) ×EVY